package com.edu.juc.completableFuture.example.bean;

import lombok.Getter;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.concurrent.TimeUnit;

@Getter
public class NetMall {
    private String mallName;

    public NetMall(String mallName) {
        this.mallName = mallName;
    }

    public BigDecimal getPrice(String productName) {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return BigDecimal.valueOf(Math.random() * 100).setScale(2, RoundingMode.HALF_UP);
    }

}
